﻿Public Class frmMain

    Private Sub btnNote_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNote.Click
        pnlMain.Controls.Clear()
        pnlMain.Controls.Add(frmNotes.plMain)
    End Sub

    Private Sub btnPhoneCalls_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhoneCalls.Click
        pnlMain.Controls.Clear()
        pnlMain.Controls.Add(frmPhoneCalls.plMain)
    End Sub

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        resizeControls()
        Me.MinimumSize = New Size(800, 600)
    End Sub

    Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        resizeControls()
    End Sub

    Private Sub resizeControls()

            ' Set the width of the tools menu to the width of the form
            pnlTools.Width = Me.Width
            ' Sets the width of the mnu strip to the width of the form
            mnuStripMainMenu.Width = Me.Width
            ' Set the width of the Status strip to the new form width
            ssMain.Width = Me.Width
            ' Undock and redock the Status strip to adjust for the new form size
            ssMain.Dock = DockStyle.None
        ssMain.Dock = DockStyle.Bottom

        For Each c As Control In pnlMain.Controls
            c.Size = pnlMain.Size
            c.Location = New Size(0, 0)
        Next

    End Sub

    Private Sub btnQuizzes_Click(sender As System.Object, e As System.EventArgs) Handles btnQuizzes.Click
        pnlMain.Controls.Clear()
        pnlMain.Controls.Add(frmQuizzes.plMain)
    End Sub
End Class
